import UserForm from "@/components/UserForm";
import { useEffect, useState } from "react";
import { useRouter } from 'next/router';
import { getUserDetail } from "@/api/user";

export default function CategoryEdit() {
    const [editData, set_editData] = useState({});
    const router = useRouter();
    const id: any = router.query.id;
    useEffect(() => {
        if (id) {
            getUserDetail(id).then(res => {
                set_editData(res.data);
            });
        }
    }, [router]);
    return (
        <UserForm title={"用户编辑"} editData={editData} />
    );
}
